<?php
include('../includes/dbConnection.php');

//mysql_query("INSERT INTO uyeler (KULLANICI_ADI,PAROLA,EMAIL,ISIM,sonSayfa,yer,KAYIT_TARIHI) VALUES('OnlineRusca','22426008','onlinerusca@gmail.com','Yonetim','anasayfa','Almanya',now())") or die(mysql_error());

$slideNum=12; //input
$presTitle="unnamed Presentation"; // input
$presId=1; // current presentation
mysql_query("INSERT INTO presentations (slideNum,presTitle) VALUES('$slideNum','$presTitle')") or die(mysql_error());
//$sqlQuery=mysql_query("SELECT * FROM presentations") or die(mysql_error());
for($i=1;$i<=$slideNum;$i++){
$pageNumber=$i;
$caption='Caption of Slide #'.$i;
$layout=1;
$bpNum=5;

$content="This is slide #$i";
if($bpNum>0){
$pagestr="";	
$pagestr.= "<ul>";
for($j=1;$j<=$bpNum;$j++){
	$pagestr.= " <li id=\"li-$i-$j\" style=\"font-size:large;\">Bullet point $j asd asdasa iasd lumpus odila koneba hudu</li>";
	//echo $pagestr;
	//echo "IIIIII".$i;
}
$pagestr.= "</ul>";
}

 echo $content;
echo $pagestr;
$content.=$pagestr;

mysql_query("INSERT INTO slides (presId,pageNumber,caption,layout,content) VALUES('$presId','$pageNumber','$caption','$layout','$content')") or die(mysql_error());
}

$sqlQuery=mysql_query("SELECT * FROM slides where presId=$presId") or die(mysql_error());
$rs=mysql_fetch_assoc($sqlQuery);

while ($rs=mysql_fetch_assoc($sqlQuery)) {
echo "FROM DATABASE:"; echo "<br />";
       $presId=$rs['presId'];
       $presTitle= $rs['caption'];
       //$slideNum=$rs['slideNum'];
       $content=$rs['content'];
	echo $presId;echo "<br />";
	//echo $slideNum; echo "<br />";
	echo $content; echo "<br />";
} //while
 
?>
